import { MainScene } from "../scenes";
import { Polygon } from "./Polygon";
import { polygon } from "../enums";
import { FourBullet } from "./FourBullet";

export class FourPolygon extends Polygon {

    constructor(scene: MainScene, x: number, y: number, row: number, col: number) {
        super(scene, x, y, polygon.four, row, col)
        scene.time.addEvent({
            delay: 3000,
            loop: true,
            callback: () => {
                if (scene.ovalNums[this.row] > 0) {
                    scene.bullets.add(new FourBullet(scene, this.x, this.y))
                }
            }
        });

    }

    protected preUpdate(time: number, delta: number): void {
        super.preUpdate(time, delta)
    }

    destroy(fromScene?: boolean): void {
        super.destroy()
    }

}